*{box-sizing:border-box}
body{
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  margin:0;
  padding:20px;
  background:#f5f7fb;
  color:#222;
}
.container{
  max-width:900px;
  margin:0 auto;
}
h1{margin-top:0}

.controls{
  background:#fff;
  padding:16px;
  border-radius:8px;
  box-shadow:0 2px 8px rgba(20,20,40,0.06);
}
.controls label{display:block;margin-bottom:12px}
#texts{
  width:100%;
  min-height:140px;
  padding:8px;
  font-size:14px;
  border:1px solid #e2e8f0;
  border-radius:6px;
  resize:vertical;
}

.row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
  margin-bottom:12px;
}
.row label{display:flex;align-items:center;gap:6px}
.trajectory-row{
  background:#f8fafc;
  padding:12px;
  border-radius:6px;
  border:2px solid #e0e7ff;
}
.trajectory-row select{
  padding:6px 12px;
  border-radius:4px;
  border:1px solid #cbd5e1;
  background:#fff;
  font-size:14px;
  cursor:pointer;
  min-width:180px;
}
.trajectory-row select:hover{
  border-color:#818cf8;
}

.buttons{
  display:flex;
  gap:8px;
  margin-bottom:8px;
  flex-wrap:wrap;
}
.file-actions{
  margin-bottom:16px;
  padding-bottom:12px;
  border-bottom:1px solid #e2e8f0;
}
.file-btn{
  background:#f8fafc;
  border:1px solid #cbd5e1;
}
.file-btn:hover:not(:disabled){
  background:#e2e8f0;
}
button{
  padding:8px 16px;
  border-radius:6px;
  border:1px solid rgba(0,0,0,0.08);
  background:#fff;
  cursor:pointer;
  transition:all 0.2s;
}
button:hover:not(:disabled){
  filter:brightness(0.95);
  transform:translateY(-1px);
}
button:disabled{
  opacity:0.5;
  cursor:not-allowed;
}
button.primary{
  background:linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color:#fff;
  border:none;
  font-weight:600;
}
button.danger{
  background:#ef4444;
  color:#fff;
  border:none;
}
.hint{color:#666;font-size:13px;margin:8px 0 0}
.hint code{
  background:#f1f5f9;
  padding:2px 6px;
  border-radius:4px;
  font-family:monospace;
  font-size:12px;
}

/* 弹窗容器 */
#popupContainer{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:9999;
}

/* 弹窗样式 */
.popup{
  position:absolute;
  transform:translate(-50%, -50%) scale(0.5);
  opacity:0;
  pointer-events:auto;
  transition:all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.popup.show{
  opacity:1;
  transform:translate(-50%, -50%) scale(1);
}
.popup.hide{
  opacity:0;
  transform:translate(-50%, -50%) scale(0.8) rotate(5deg);
}

.popup-content{
  position:relative;
  min-width:180px;
  max-width:400px;
  padding:20px 28px;
  border-radius:16px;
  box-shadow:0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1) inset;
  text-align:center;
  backdrop-filter:blur(10px);
}

.popup-text{
  line-height:1.4;
  white-space:pre-wrap;
  word-break:break-word;
  font-weight:600;
  text-shadow:0 1px 2px rgba(0,0,0,0.1);
}

.popup .close{
  position:absolute;
  right:8px;
  top:6px;
  background:rgba(0,0,0,0.1);
  border:none;
  font-size:22px;
  cursor:pointer;
  color:inherit;
  width:28px;
  height:28px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all 0.2s;
  line-height:1;
}
.popup .close:hover{
  background:rgba(0,0,0,0.2);
  transform:rotate(90deg);
}

/* 响应式 */
@media (max-width:600px){
  .row{flex-direction:column;align-items:stretch}
  .buttons{flex-direction:column}
  .popup-content{
    max-width:280px;
    padding:16px 20px;
  }
}